<template>
  <van-grid :border="false" :column-num="3" :gutter="10" square>
  
    <van-grid-item v-for="(item, index) in courses" :key="index" :icon="item.icon" :text="item.text" :to="item.path" />


  </van-grid>
  <h1>{{ markPorK }}</h1>
</template>

<script>
import { Grid, GridItem } from 'vant';
export default {
  name: 'middleGrids',
  props: ["markPorK"],
  components: {
    [Grid.name]: Grid,
    [GridItem.name]: GridItem
  },
  // date() {
  //   return {
  //     // 测试用的数据
  //     courses: [
  //       {
  //         id: '1',
  //         text: 'Java',
  //         icon: 'photo-o',
  //         photo: 'photo-o'
  //       },
  //       {
  //         id: '2',
  //         text: 'JavaScript',
  //         icon: 'photo-o',
  //         photo: 'photo-o'
  //       },

  //     ]
  //   }
  // },

  setup() {
    const courses = [
      {
        id: '1',
        text: 'Java',
        icon: 'photo-o',
        photo: 'photo-o'
      },
      {
        id: '2',
        text: 'JavaScript',
        icon: 'photo-o',
        photo: 'photo-o'
      },
    ]
    return { courses };
  },

}
</script>

<style scoped>
</style>